home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 38
/
Amiga Format CD38 (1999-03-15)(Future Publishing)(GB)(Track 1 of 3)[!][issue 1999-04].iso
/
-in_the_mag-
/
reader_requests
/
dice_v3.15
/
lib
/
fd
/
mkdir.c
< prev
next >
Wrap
C/C++ Source or Header
|
1999-01-26
|
682b
|
38 lines
/*
* MKDIR.C
*
* (c)Copyright 1992-1997 Obvious Implementations Corp. Redistribution and
* use is allowed under the terms of the DICE-LICENSE FILE,
* DICE-LICENSE.TXT.
*/
#include <clib/dos_protos.h>
#include <exec/types.h>
#include <libraries/dos.h>
#include <errno.h>
#ifndef UnixToAmigaPath
#define UnixToAmigaPath(path) path
#endif
int
mkdir(fileName)
const char *fileName;
{
BPTR lock;
int error;
if (lock = CreateDir(UnixToAmigaPath(fileName))) {
UnLock(lock);
return(0);
}
error = IoErr();
if (error == ERROR_OBJECT_EXISTS || error == ERROR_DIRECTORY_NOT_EMPTY)
errno = EEXIST;
else
errno = ENOFILE;
return(-1);
}